package com.mobi.Survey.map;

import android.graphics.Bitmap;
import android.widget.Toast;

import com.mobi.Survey.lib.activities.AbstractScreen;

public abstract class MyTab extends AbstractScreen {
	private long prevClick = 0;

	@Override
	protected void onRelease() {

		if (AbstractScreen.getMapTabId(this) == -1) {

			for (String key : MapLogin.getUserListIcons().keySet()) {
				Bitmap b = MapLogin.getUserListIcons().get(key);
				if (null != b && !b.isRecycled()) {
					b.recycle();
				}

			}
			MapLogin.getUserListIcons().clear();
			MapLogin.getSerachContext().city = "";
			MapLogin.getSerachContext().country = "";
			MapLogin.getSerachContext().keyword = "";
			MapLogin.getSerachContext().zip = "";
			MapLogin.getSerachContext().state = "";
			
			
		}

	}

	@Override
	public void onBackPressed() {
		long curTime = System.currentTimeMillis();
		if (prevClick == 0 || (curTime - prevClick) > MapTabHost.CLOSE_TIME) {
			prevClick = curTime;
			Toast.makeText(this, "Press again to exit", Toast.LENGTH_SHORT)
					.show();
		} else

			super.onBackPressed();
	}

}
